import * as ajax from "../../common/ajax";

export const get = courseId => ajax.get("/admin/course/" + courseId);

export const create = entity => ajax.post("/admin/course", entity);

export const deleteItem = courseId =>
  ajax.pureDelete("/admin/course/" + courseId);

export const update = entity => ajax.put("/admin/course", entity);

export const getPageCount = () => ajax.get("/admin/course/page/count");

export const getPage = index => ajax.get("/admin/course/page/" + index);

export const queryAllSemester = () => ajax.get("/admin/course/term");
export const arrange = requestData =>
  ajax.post(
    "/admin/course/arrange/" + requestData.term + "/" + requestData.classDates
  );

export const listName = () => ajax.pureGet("/admin/course/names");

export const pageSize = 15;
